home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / BLAKJACK.PAK / OWLMAIN.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  120 lines

  1. //-----------------------------------------------------------------------------
  2. // ObjectWindows - (C) Copyright 1995 by Borland International
  3. // Owlmain.h
  4. //-----------------------------------------------------------------------------
  5. #ifndef OWLMAIN_H
  6. #define OWLMAIN_H
  7.  
  8. class TBlackjackFrame: public TFrameWindow {
  9.   public:
  10.     TBlackjackFrame(TWindow* parentWindow,
  11.                     const char far* title,
  12.                     TWindow* clientWnd,
  13.                     bool shrinkToClient)
  14.       : TFrameWindow(parentWindow, title, clientWnd, shrinkToClient) {}
  15.  
  16.    ~TBlackjackFrame() {}
  17.  
  18.     void SetupWindow();
  19.  
  20.     TWindow* BlackjackDialog;
  21. };
  22.  
  23. class TBlackjack : public TDialog {
  24.   public:
  25.     TBrush      Brush;
  26.     TButton     *pBankrollBtn;
  27.     TButton     *pBetBtn;
  28.     TButton     *pHitBtn;
  29.     TButton     *pStandBtn;
  30.  
  31.     TStatic     *pIdDispBankroll1;
  32.     TStatic     *pIdDispBet;
  33.     TStatic     *pIdDispPPoints;
  34.     TStatic     *pIdDispDPoints;
  35.  
  36.     TEdit       *pEInputBankRoll;
  37.     TEdit       *pEInputBet;
  38.  
  39.     TFilterValidator *pValidBankRoll;
  40.     TFilterValidator *pValidBet;
  41.     TVbxMhCardDeck   *ppVBXCard[52];
  42.  
  43.     // VBXCardCount, keeps the card count of the  VBX cards.
  44.     // Count 12 means, 0 to 11 cards have been dealt.
  45.     int VBXCardCount;
  46.  
  47.     TInputDialog *pInputDialog;
  48.  
  49.     // This is the black jack class.
  50.     Blackjack bj;
  51.  
  52.     TBlackjack(TWindow *pWin);
  53.     ~TBlackjack();
  54.  
  55.     // Displays the cards in the dialog.
  56.     void   InitBlackjack();
  57.  
  58.   protected:
  59.     void    SetupWindow();
  60.     bool    EvInitDialog(HWND hWnd);
  61.     void    DisplayCardOnTable();
  62.     void    RemoveAllCardsOnTable();
  63.     void    IdStandBtn();
  64.     void    IdHitBtn();
  65.     void    IdBankrollBtn();
  66.     void    IdBetBtn();
  67.     void    ProcessBetButton();
  68.     void    ProcessPlayButton();
  69.     void    IdDispPPoints();
  70.     void    gameOverCleanupBusted(int) throw (const char*);
  71.     void    CheckBankRollInput();
  72.     void    CheckBetInput();
  73.  
  74.     operator << (Dealer& rhs);
  75.     operator << (Player& rhs);
  76.  
  77.   private:
  78.     static const int TextLen;
  79.     int BankRollEnteredFirstTime;
  80.     char prevBet[20];
  81.     char prevBankroll[20];
  82.  
  83.   DECLARE_RESPONSE_TABLE(TBlackjack);
  84. };
  85.  
  86. class TBlackjackApp : public TApplication {
  87.   public:
  88.     TBlackjackApp(const char far* name) : TApplication(name) {}
  89.  
  90.     void   InitMainWindow();
  91.     void   IdAbout();
  92.  
  93.     LRESULT       EvCommand(UINT, HWND, UINT);
  94.  
  95.   private:
  96.     TVbxMhCardDeck *pCard;
  97.  
  98.   DECLARE_RESPONSE_TABLE(TBlackjackApp);
  99. };
  100.  
  101. class MovableDialog: public TDialog {
  102.   public:
  103.     MovableDialog(int topLeft_x, int topLeft_y, TWindow *pWin, TResId id):
  104.     TDialog(pWin, id),
  105.     topLeftX(topLeft_x), topLeftY(topLeft_y){}
  106.  
  107.     ~MovableDialog(){};
  108.  
  109.     // Move the dialog here
  110.     void SetupWindow();
  111.  
  112.   private:
  113.     int topLeftX, topLeftY;
  114. };
  115.  
  116. int ConvToVBXNum(int cardNum);
  117. int ConvToVBXSuite(int cardSuite);
  118.  
  119. #endif
  120.